package mysql

import "gorm.io/gorm"

type Product struct {
	gorm.Model
	ProductName  string  `gorm:"type:varchar(20);not null"`
	ProductPrice float32 `gorm:"type:decimal(10,2);not null"`
	ProductImage string  `gorm:"type:varchar(500);not null"`
	ProductStock int64   `gorm:"type:int(11);not null"`
	UserId       int64   `gorm:"type:int(11);not null"`
}

func (p *Product) ProductAdd(db *gorm.DB) error {
	return db.Debug().Create(p).Error
}
